package com.zjuee.base.dto.common.plan;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.zjuee.base.base.Converter;
import com.zjuee.base.bean.Pages;
import com.zjuee.base.model.common.plan.PlanTreat;
import lombok.*;
import org.springframework.beans.BeanUtils;

/**
 * @author ding jinli
 * @since 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class PlanTreatDto extends PlanTreat implements Converter<PlanTreat, PlanTreatDto> {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Pages page;

    @Override
    public void convertToDo(PlanTreat planTreat) {
        BeanUtils.copyProperties(this, planTreat);
    }

    @Override
    public PlanTreatDto convert(PlanTreat planTreat) {
        BeanUtils.copyProperties(planTreat, this);
        return this;
    }
}
